/****************************************************************/
/* 	Author:		Gina Branton	     							*/
/*	Date:		March 16, 2024  								*/
/*  File:		Native_trust_models.do 	       					*/
/*	Purpose:	run models						  				*/
/*  Input File: dataverse_nativetrust.dta				   					*/
/*  Log File:   												*/
/****************************************************************/

use dataverse_nativetrust.dta 

/* Models in Table 2 of the Paper*/
version 9: ologit trustgovt ext_efficacy hope_natecon linkfate_native tribal_involvement age female educ dem ind lib mod no_ideology income refuse_income log_county_pct_indian [pw=os_weight] if native_american==1 , cluster(stcoufips) or

version 9: ologit trustgovt ext_efficacy hope_natecon linkfate_native tribal_involvement age female educ dem ind lib mod no_ideology income refuse_income log_county_pct_indian [pw=os_weight] if native_american==1 , cluster(stcoufips) 
prvalue, x(hope_natecon=min) rest(mean) save level(94)
prvalue, x(hope_natecon=max) rest(mean) diff level(94)

prvalue, x(ext_efficacy=min) rest(mean) save
prvalue, x(ext_efficacy=max) rest(mean) diff

prvalue, x(linkfate_native=min) rest(mean) save
prvalue, x(linkfate_native=max) rest(mean) diff

prvalue, x(tribal_involvement=min) rest(mean) save
prvalue, x(tribal_involvement=max) rest(mean) diff


version 9: ologit trust_local_govt ext_efficacy hope_natecon linkfate_native tribal_involvement age female educ dem ind lib mod no_ideology income refuse_income log_county_pct_indian [pw=os_weight] if native_american==1 , cluster(stcoufips) or

version 9: ologit trust_local_govt ext_efficacy hope_natecon linkfate_native tribal_involvement age female educ dem ind lib mod no_ideology income refuse_income log_county_pct_indian [pw=os_weight] if native_american==1 , cluster(stcoufips)
prvalue, x(hope_natecon=min) rest(mean) save level(94)
prvalue, x(hope_natecon=max) rest(mean) diff level(94)

prvalue, x(ext_efficacy=min) rest(mean) save
prvalue, x(ext_efficacy=max) rest(mean) diff

prvalue, x(linkfate_native=min) rest(mean) save
prvalue, x(linkfate_native=max) rest(mean) diff

prvalue, x(tribal_involvement=min) rest(mean) save
prvalue, x(tribal_involvement=max) rest(mean) diff


/* Appendix A*/
/* test of proportional odds assumption */
version 9: gologit2 trustgovt ext_efficacy hope_natecon linkfate_native tribal_involvement age female educ dem ind lib mod no_ideology income refuse_income log_county_pct_indian if native_american==1, pl sto(ologit)

version 9: gologit2 trustgovt ext_efficacy hope_natecon linkfate_native tribal_involvement age female educ dem ind lib mod no_ideology income refuse_income log_county_pct_indian if native_american==1, npl sto(gologit)

lrtest ologit gologit, stats

ologit trustgovt ext_efficacy hope_natecon linkfate_native tribal_involvement age female educ dem ind lib mod no_ideology income refuse_income log_county_pct_indian if native_american==1, vce(robust)
brant

version 9: gologit2 trustgovt ext_efficacy hope_natecon linkfate_native tribal_involvement age female educ dem ind lib mod no_ideology income refuse_income log_county_pct_indian [pw=os_weight] if native_american==1 , cluster(stcoufips) autofit


version 9: gologit2 trust_local_govt ext_efficacy hope_natecon linkfate_native tribal_involvement age female educ dem ind lib mod no_ideology income refuse_income log_county_pct_indian [pw=os_weight] if native_american==1 , cluster(stcoufips) autofit

/* Actual Results presented in Table A in the Appendix */
gologit2 trust_local_govt ext_efficacy hope_natecon linkfate_native tribal_involvement age female educ dem ind lib mod no_ideology income refuse_income log_county_pct_indian [pw=os_weight] if native_american==1, pl(educ hope_natecon ind refuse_income log_county_pct_indian age female linkfate_native tribal_involvement moderate no_ideology liberal ext_efficacy) cluster(stcoufips)

prvalue, x(hope_natecon=min) rest(mean) save level(94)
prvalue, x(hope_natecon=max) rest(mean) diff level(94)

prvalue, x(ext_efficacy=min) rest(mean) save
prvalue, x(ext_efficacy=max) rest(mean) diff

prvalue, x(linkfate_native=min) rest(mean) save
prvalue, x(linkfate_native=max) rest(mean) diff

prvalue, x(tribal_involvement=min) rest(mean) save
prvalue, x(tribal_involvement=max) rest(mean) diff



/* Models in Table B of the Appendix */ 
version 9: ologit trustgovt ext_efficacy hope_natecon linkfate_native tribal_involvement age female educ dem ind lib mod no_ideology income refuse_income log_county_pct_indian miles_rez county_pct_urban [pw=os_weight] if native_american==1 , cluster(stcoufips) 


version 9: ologit trust_local_govt ext_efficacy hope_natecon linkfate_native tribal_involvement age female educ dem ind lib mod no_ideology income refuse_income log_county_pct_indian miles_rez county_pct_urban[pw=os_weight] if native_american==1 , cluster(stcoufips)



/* Models in Table C of the Appendix */ 
version 9: ologit trustgovt ext_efficacy unemploy_rate  linkfate_native tribal_involvement age female educ dem ind lib mod no_ideology income refuse_income log_county_pct_indian [pw=os_weight] if native_american==1 , cluster(stcoufips)

tab trustgovt trust_local_govt if e(sample), chi
pwcorr trustgovt trust_local_govt if e(sample), sig
  
prvalue, x(unemploy_rate=min) rest(mean) save
prvalue, x(unemploy_rate=max) rest(mean) diff

prvalue, x(ext_efficacy=min) rest(mean) save
prvalue, x(ext_efficacy=max) rest(mean) diff

prvalue, x(linkfate_native=min) rest(mean) save
prvalue, x(linkfate_native=max) rest(mean) diff

prvalue, x(tribal_involvement=min) rest(mean) save
prvalue, x(tribal_involvement=max) rest(mean) diff

version 9: ologit trust_local_govt ext_efficacy unemploy_rate linkfate_native tribal_involvement age female educ dem ind lib mod no_ideology income refuse_income log_county_pct_indian [pw=os_weight] if native_american==1 , cluster(stcoufips)
tab trust_local_govt if e(sample)
tab trustgovt if e(sample)

prvalue, x(unemploy_rate=min) rest(mean) save
prvalue, x(unemploy_rate=max) rest(mean) diff

prvalue, x(ext_efficacy=min) rest(mean) save
prvalue, x(ext_efficacy=max) rest(mean) diff

prvalue, x(linkfate_native=min) rest(mean) save
prvalue, x(linkfate_native=max) rest(mean) diff

prvalue, x(tribal_involvement=min) rest(mean) save
prvalue, x(tribal_involvement=max) rest(mean) diff



